FROM mysql:5.7

# 维护者信息
MAINTAINER Deng Hui <denghui0115@sina.com>

RUN ln -fs /usr/share/zoneinfo/$TZ /etc/localtime && \
echo $TZ > /etc/timezone && \        
echo \
"[mysqld]\n"\
"init_connect='SET collation_connection = utf8mb4_unicode_ci'\n"\
"init_connect='SET NAMES utf8mb4'\n"\
"character-set-server=utf8mb4\n"\
"collation-server=utf8mb4_unicode_ci\n"\
"skip-character-set-client-handshake\n"\
"[client]\n"\
"default-character-set=utf8mb4\n"\
"[mysql]\n"\
"default-character-set=utf8mb4\n" >> /etc/mysql/conf.d/docker.cnf

EXPOSE 3306
CMD ["mysqld"]

